import axios from '@/request/http';
import base from "./base";

const message = {
  getMessages(){
    return axios.get(`${base.sq}/messages`)
  },
  messageDelete({id}){
    return axios.delete(`${base.sq}/messages/${id}`)
  },
  messagePatch(id,message){
    console.log(`${base.sq}/messages/${id}`)
    return axios.patch(`${base.sq}/messages/${id}`,message)
  },
  messageAdd(payload){
    return axios.post(`${base.sq}/messages/`,payload)
  },
  getMessageType() {
    return axios.get(`${base.sq}/messageTypes`)
  },

  messageTypeDelete({id}){
    return axios.delete(`${base.sq}/messageTypes/${id}`)
  },
  messageTypePatch(id,messageType){
    return axios.patch(`${base.sq}/messageTypes/${id}`,messageType)
  }
}

export default message;
